package com.bitsbazaar.manager;

import java.util.List;

import com.bitsbazaar.entity.Product;
import com.bitsbazaar.entity.User;

public interface ProductManager {
	/**
	 * Saves the product 
	 * 
	 * @param	The product to save	
	 * @return 	The key(id) generated if success, -1 if failure/exception
	 * @author 	Rachit
	 */
	public Long createProduct(Product product);

	public Product getProductById(Long id);
	
	public Boolean updateProduct(Product product);

	public Boolean deleteProductById(Long id);
	
	public Boolean adminAuthenticateByEmail(String email, String password);
	
	public User getUserByEmail(String email);

	/**
	 * @return 	a list of all products of the given sub category
	 * @author 	Rachit
	 */
	List<Product> getProductsBySubCat(Long subcatId);

	/**
	 * Get the Approved or Not Approved Products of the given subcategory
	 * 
	 * @param 	approved	0-not approved, 1-approved
	 * @return 	a list of all products of the given sub category which have the approved status
	 * @author 	Rachit
	 */
	List<Product> getApprovedProductsBySubCat(Long subCatId, int approved);

	List<Product> getApprovedProducts(int approved);

	
	
}
